package org.coolsugar.httpclient.controller;


import org.coolsugar.httpclient.service.HttpClientService;
import org.coolsugar.httpclient.vo.ObjectUtil;
import org.coolsugar.httpclient.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HttpClientController {
	@Autowired
	private HttpClientService client;
	
	@RequestMapping("/go")
	@ResponseBody
	public String go() throws Exception {
		String url="http://localhost:6666/next";
		String dataJson=client.doGet(url);
//		String result=ObjectUtil.mapper.readValue(dataJson, String.class);
		
		return dataJson;
	}
	
	@RequestMapping("/next")
	@ResponseBody
	public String next() {
		System.out.println("next now ");
		
		return "next now";
	}
	
}
